import java.util.concurrent.Callable;

interface USB{
     void close();
     void open();
}
class Mouse implements USB{
    @Override
    public void close() {
        System.out.println("关闭鼠标");
    }
    public void open(){
        System.out.println("打开鼠标");
    }
    public void click(){
        System.out.println("点击鼠标");
    }
}
class KeyBoard implements USB{
    public void close(){
        System.out.println("关闭键盘");
    }

    @Override
    public void open() {
        System.out.println("开启键盘");
    }
    public void input(){
        System.out.println("输入功能");
    }
}
class Computer implements USB{
    @Override
    public void close() {
        System.out.println("关闭电脑");
    }
    public void open(){
        System.out.println("打开电脑");
    }
    public void use(USB usb){
        usb.open();
        if(usb instanceof Mouse){
            ((Mouse) usb).click();
        }else{
            ((KeyBoard)usb).input();
        }
        usb.close();
    }

}
public class Test {
    public static void main(String[] args) {
       Computer computer=new Computer();
       computer.open();
       USB usb1=new Mouse();
       computer.use(usb1);
       System.out.println("=======");
       USB usb2=new KeyBoard();
       computer.use(usb2);
       computer.close();
    }
}
